{{ extend '../_layouts/home.html' }}

{{ block 'title' }}{{currentuser.nickname}}参与的话题{{ /block }}

{{ block 'body' }} 
<section class="container">
    <div class="col-md-9">
        <div class="bg3Color">
            <div class="user_header">
                <ul class="breadcrumb">
                    <li><a href="/" class="breadcrumb-active">主页</a></li>
                    <li><a href="/settings/{{currentuser.nickname}}" class="breadcrumb-active">{{currentuser.nickname}}的主页</a></li>
                </ul>
            </div>
        </div>
        <div class="bg3Color margintop">
            <div class="user_header">
                <ul class="breadcrumb">
                    <li>{{currentuser.nickname}}参与的话题</li>
                </ul>
            </div>
            <div class="topic_participate">
                <ul class="topic-list" id="commentInfo">
                    {{ each comment cmt }}
                    <li class="createdTopic-list-item addme">
                        {{ each authors author }}
                        {{ if formateId(cmt.topics[0].uId)==formateId(author._id) }}
                        <a href="/settings/{{author.nickname}}" class="pullme-left avatar marginright" title="{{author.nickname}}">
                            <img src="{{author.avatar}}" alt="">
                        </a>
                        {{ /if }}
                        {{ /each }}
                        <span class="pullme-right beforeTime">{{fromNowFormat(cmt.topics[0].created_time)}}</span>
                        <div class="newtopic-title-wrapper">
                            <a href="/topic/show/{{ formateId(cmt.topics[0]._id) }}" class="newtopic_title pullme-left" title="{{cmt.topics[0].title}}">{{cmt.topics[0].title}}</a>
                            <div class="clear pullme-left">
                                <span class="myellipsis">{{cmt.content}}</span>
                            </div>
                        </div>
                    </li>
                    {{/each }}
                </ul>
                <div class="pagehelper">
                    <div id="demo3"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="bg3Color">
            <div class="user_header">
                <ul class="breadcrumb">
                    <li>个人信息</li>
                </ul>
            </div>
            <div class="user-info">
                <a href="/settings/{{currentuser.nickname}}" class="user-avatar">
                    <img src="{{ currentuser.avatar }}" alt="">
                </a>
                <a href="/settings/{{currentuser.nickname}}" class="user-nickname">{{ currentuser.nickname }}</a>
                <div class="score">
                    <span>积分：{{ currentuser.score }}</span>
                </div>
                <div class="bio">
                    <span>" {{ currentuser.bio }} "</span>
                </div>
            </div>
        </div>
    </div>
</section>
{{ /block }}
{{ block 'script' }}
<script>
layui.use(['laypage', 'layer'], function(){
    var laypage = layui.laypage
    ,layer = layui.layer;      
    //总页数大于页码总数
    laypage.render({
        elem: 'demo3',
        limit: '{{ limit }}',  // 每页显示的条数
        curr: '{{ currentPage || 1 }}',  // 当前页，页面点击
        count: '{{ total }}', //数据总数
        jump: function(obj, first){
            if (!first) {  //首次不执行
                window.location.href = '?tab=replies&page=' + obj.curr
            }
        }
    });
});
</script>
{{ /block }}
